A plataforma HyperPay oferece um guia completo e fácil de usar para habilitar a integração sem problemas do nosso gateway de pagamento de ponta a ponta para dispositivos móveis.
Orientação gerada a partir de informações públicas. Apenas para referência.
O plugin HyperPay é um pacote Flutter/Dart que permite a integração sem problemas da gateway de pagamento end-to-end HyperPay em aplicativos móveis. Projetado para Android e iOS, ele simplifica o processo de adicionar processamento de pagamentos seguro e confiável com configuração mínima. O plugin fornece uma API simples para gerenciar transações, tokenização e confirmação de pagamento, garantindo uma experiência de checkout suave. É ideal para desenvolvedores que desejam oferecer múltiplos métodos de pagamento por meio de uma interface unificada. Com suporte oficial da plataforma HyperPay, garante conformidade com padrões da indústria e rastreamento em tempo real de transações.
Casos de uso
Compras no aplicativo
Checkout de comércio eletrônico
Integração de carteira móvel
Faturamento de assinatura
Processamento de pagamento para serviços digitais
Principais recursos
Suporte multiplataforma (Android e iOS)
Tokenização de pagamento segura
Integração fácil com a gateway HyperPay
Status de transação em tempo real
Suporte para múltiplos métodos de pagamento
Indicado para
Desenvolvedores Flutter construindo aplicativos de comércio eletrônico
Startups que precisam de integração de pagamento rápida
Aplicativos que exigem suporte a múltiplas moedas
Desenvolvedores usando o HyperPay como seu provedor de pagamento
Projetos com necessidades rigorosas de segurança e conformidade
Considerações
Requer conta HyperPay e credenciais da API
Limitado às regiões suportadas pela HyperPay
Dependente da estabilidade da gateway externa
Necessita de tratamento adequado de estados de erro
Pode exigir configuração adicional para recursos avançados
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
HyperPay SDK Plugin
The HyperPay platform offers a complete, easy-to-use guide to enable seamless integration of our end-to-end payment gateway for mobile and desktop browsers. Through a unified API, you can enable and gain access to all platform features. Choose one of the options below to quickly get started
Support ReadyUI , CustomUI
VISA,MasterCard
STC
Apple Pay
MADA( Saudi Arabia )
Android Setup
Open android/app/build.gradle and add the following lines
shopperResultUrl since mSDK version 6.0.0 the shopper result URL is not required
The Scheme field must match the InAppPaymentSetting.shopperResultUrl field.
Don't make Scheme like com.testPayment.Payment avoid capital letters in Android.
It's used when making a payment outside the app (Like open browser) and back into the app
IOS Setup
Open Podfile, and paste the following inside of it:
pod 'hyperpay_sdk', :git => 'https://github.com/ahmedelkhyary/hyperpay_sdk.git'
$static_framework = ['hyperpay_plugin']
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name)
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
Add Url Scheme to the list of bundle identifiers.
The Url Scheme field must match the InAppPaymentSetting.shopperResultUrl field.
Setup HyperPay Environment Configuration
define instanse of FlutterHyperPay
lateFlutterHyperPay flutterHyperPay ;
flutterHyperPay = FlutterHyperPay(
shopperResultUrl: InAppPaymentSetting.shopperResultUrl, // return back to app
paymentMode: PaymentMode.test, // test or live
lang: InAppPaymentSetting.getLang(),
);
create a method to get the checkoutId
/// URL TO GET CHECKOUT ID FOR TEST /// THIS LINK UNAVAILABLE NOW/// http://dev.hyperpay.com/hyperpay-demo/getcheckoutid.php/// Brands Names [ VISA , MASTER , MADA , STC_PAY , APPLEPAY]getCheckOut() async {
final url = Uri.parse('https://dev.hyperpay.com/hyperpay-demo/getcheckoutid.php');
final response = await http.get(url);
if (response.statusCode == 200) {
payRequestNowReadyUI(
checkoutId: json.decode(response.body)['id'],
brandsName: [ "VISA" , "MASTER" , "MADA" ,"PAYPAL", "STC_PAY" , "APPLEPAY"]);
}else{
dev.log(response.body.toString(), name: "STATUS CODE ERROR");
}
}
If you want using readyUI send checkoutId and List of brandsName to Plugin
Brands Names support [ VISA , MASTER , MADA , STC_PAY , APPLEPAY]
payRequestNowReadyUI(
{requiredList<String> brandsName, requiredString checkoutId}) async {
PaymentResultData paymentResultData;
paymentResultData = await flutterHyperPay.readyUICards(
readyUI: ReadyUI(
brandsName: brandsName ,
checkoutId: checkoutId,
merchantIdApplePayIOS: InAppPaymentSetting.merchantId, // applepay
countryCodeApplePayIOS: InAppPaymentSetting.countryCode, // applePay
companyNameApplePayIOS: "Test Co", // applePay
themColorHexIOS: "#000000" ,// FOR IOS ONLY
setStorePaymentDetailsMode: true// store payment details for future use
),
);
}
classInAppPaymentSetting{
// shopperResultUrl : this name must like scheme in intent-filter, url scheme in xcode// Avoid capital letters like `com.testPayment.Payment`, as it will not work in Android.staticconstString shopperResultUrl= "com.testpayment.payment";
staticconstString merchantId= "MerchantId";
staticconstString countryCode="SA";
staticgetLang() {
if (Platform.isIOS) {
return"en"; // ar
} else {
return"en_US"; // ar_AR
}
}
}