Billing Agreement with Payment
This example shows how to create a billing agreement with payment by calling these services:
npayPalEcSetService
npayPalEcGetDetailsService
npayPalEcDoPaymentService
npayPalDoCaptureService
payPalEcSetService_run=true merchantID=HomeTownNewspaper merchantReferenceCode=HTNsubscription9647 purchaseTotals_currency=USD payPalEcSetService_paypalReturn=http://www.cybersource.com payPalEcSetService_paypalCancelReturn=http://www.cybersource.com/cancel payPalEcSetService_paypalBillingAgreementDesc= payPalEcSetService_paypalBillingAgreementCustom=One-year subscription payPalEcSetService_paypalBillingType=MerchantInitiatedBilling payPalEcSetService_paypalPaymentType=instant purchaseTotals_grandTotalAmount=4.99 |
decision=ACCEPT reasonCode=100 payPalEcSetReply_reasonCode=100 requestID=1928320121920167904854 requestToken=Aeuvj6IjRRjVhjIZWEEvhhf8jZL4YX/I20gRk merchantReferenceCode=HTNsubscription9647 payPalEcSetReply_correlationID=4lks03uw2lbwxu payPalEcSetReply_paypalToken=EC-2UN29359TV924162S payPalEcSetReply_errorCode=93045SLWVO payPalEcSetReply_amount=4.99 |
payPalEcGetDetailsService_run=true merchantID=HomeTownNewspaper merchantReferenceCode=HTNsubscription9647 payPalEcGetDetailsService_paypalEcSetRequestID=1928320121920167904854 payPalEcGetDetailsService_paypalEcSetRequestToken= payPalEcGetDetailsService_paypalToken=EC-2UN29359TV924162S |
decision=ACCEPT reasonCode=100 payPalEcGetDetailsReply_reasonCode=100 requestID=29FJBLS93TBQPSLDGK3H requestToken=Bxwje3Ijb7OskjK6HGG0XF3vllnoyf merchantReferenceCode=HTNsubscription9647 payPalEcGetDetailsReply_paypalBillingAgreementAcceptedStatus=1 payPalEcGetDetailsReply_correlationID=sldkf9325sdfsdlkjgj payPalEcGetDetailsReply_avsCode=3 payPalEcGetDetailsReply_paypalToken=EC-2UN29359TV924162S payPalEcGetDetailsReply_errorCode=93045SLWVO payPalEcGetDetailsReply_addressStatus=Confirmed payPalEcGetDetailsReply_payerID=S6D5ETGSVYX94 payPalEcGetDetailsReply_payerStatus=verified payPalEcGetDetailsReply_payerFirstname=Jane payPalEcGetDetailsReply_payerLastname=Smith payPalEcGetDetailsReply_payerCountry=US payPalEcGetDetailsReply_payer=jsmith@example.com payPalEcGetDetailsReply_shipToName=Jane Smith payPalEcGetDetailsReply_shipToAddress1=1295 Charleston Rd. payPalEcGetDetailsReply_shipToCity=Mountain View payPalEcGetDetailsReply_shipToState=CA payPalEcGetDetailsReply_shipToCountry=US payPalEcGetDetailsReply_shipToZip=94043 |
payPalEcDoPaymentService_run=true merchantID=HomeTownNewspaper merchantReferenceCode=HTNsubscription9647 payPalEcDoPaymentService_paypalEcSetRequestID=1928323124420167904854 payPalEcDoPaymentService_paypalEcSetRequestToken= payPalEcDoPaymentService_paypalToken=EC-2UN29359TV924162S payPalEcDoPaymentService_paypalCustomerEmail=jsmith@examples.com payPalEcDoPaymentService_paypalPayerId=S6D5ETGSVYX94 purchaseTotals_currency=USD purchaseTotals_grandTotalAmount=4.99 |
decision=ACCEPT reasonCode=100 payPalEcDoPaymentReply_reasonCode=100 requestID=TN10C8B3MHS0AK3BKSGN8 requestToken=Crdug4OkpF2Qfd8oXDD0ZE4vpp24 merchantReferenceCode=HTNsubscription9647 payPalEcDoPaymentReply_paypalBillingAgreementId=3ADOib340UWM8923lf20 payPalEcDoPaymentReply_correlationID=sldkf9325sdfsdlkjgj payPalEcDoPaymentReply_paypalToken=EC-2UN29359TV924162S payPalEcDoPaymentReply_paypalPaymentStatus=Pending payPalEcDoPaymentReply_transactionId=2YG99268YE540943P payPalEcDoPaymentReply_paymentType=None payPalEcDoPaymentReply_paypalTaxAmount=0.00 payPalEcDoPaymentReply_orderId=O-58X525738C493004E payPalEcDoPaymentReply_paypalTransactiontype=expresscheckout payPalEcDoPaymentReply_paypalPendingReason=order payPalEcDoPaymentReply_errorCode=93045SLWVO |
payPalDoCaptureService_run=true merchantID=HomeTownNewspaper merchantReferenceNumber=HTNsubscription9647 payPalDoCaptureService_paypalEcDoPaymentRequestID=TN10C8B3MHS0AK3BKSGN8 payPalDoCaptureService_paypalEcDoPaymentRequestToken= payPalDoCaptureService_completeType=Complete payPalDoCaptureService_paypalAuthorizationId=2YG99268YE540943P purchaseTotals_grandTotalAmount=4.99 |
decision=ACCEPT reasonCode=100 payPalDoCaptureReply_reasonCode=100 requestID=FY25W8N9OWC2LE7WOCBU5 requestToken=Dtely5OsoW3Pnw0mWVV9x26mll35 merchantReferenceCode=HTNsubscription9647 payPalDoCaptureReply_transactionId=2SA82969X3543562X payPalDoCaptureReply_parentTransactionId=2YG99268YE540943P payPalDoCaptureReply_authorizationId=2YG99268YE540943P payPalDoCaptureReply_paypalPaymentStatus=Completed payPalDoCaptureReply_errorCode=93045SLWVO payPalDoCaptureReply_correlationId=gwlbof9325biwflpaj payPalDoCaptureReply_paypalPaymentType=instant payPalDoCaptureReply_paypalPaymentGrossAmount=4.99 payPalDoCaptureReply_paypalTaxAmount=0.00 payPalDoCaptureReply_paypalFeeAmount=0.36 payPalDoCaptureReply_paypalTransactiontype=expresscheckout |
Billing Agreement without Payment
This example shows how to create a billing agreement without payment by calling these services:
npayPalEcSetService
npayPalEcGetDetailsService
npayPalCreateAgreementService
payPalEcSetService_run=true merchantID=HomeTownNewspaper merchantReferenceCode=HTNsubscription9647 purchaseTotals_currency=USD payPalEcSetService_paypalReturn=http://www.cybersource.com payPalEcSetService_paypalCancelReturn=http://www.cybersource.com/cancel payPalEcSetService_paypalBillingAgreementDesc= payPalEcSetService_paypalBillingAgreementCustom=One-year subscription payPalEcSetService_paypalBillingType=MerchantInitiatedBilling payPalEcSetService_paypalPaymentType=instant purchaseTotals_grandTotalAmount=0 |
decision=ACCEPT reasonCode=100 payPalEcSetReply_reasonCode=100 requestID=1928320121920167904854 requestToken=Aeuvj6IjRRjVhjIZWEEvhhf8jZL4YX/I20gRk merchantReferenceCode=HTNsubscription9647 payPalEcSetReply_correlationID=4lks03uw2lbwxu payPalEcSetReply_paypalToken=EC-2UN29359TV924162S payPalEcSetReply_errorCode=93045SLWVO payPalEcSetReply_amount=0 |
payPalEcGetDetailsService_run=true merchantID=HomeTownNewspaper merchantReferenceCode=HTNsubscription9647 payPalEcGetDetailsService_paypalEcSetRequestID=1928320121920167904854 payPalEcGetDetailsService_paypalEcSetRequestToken= payPalEcGetDetailsService_paypalToken=EC-2UN29359TV924162S |
decision=ACCEPT reasonCode=100 payPalEcGetDetailsReply_reasonCode=100 requestID=29FJBLS93TBQPSLDGK3H requestToken=Bxwje3Ijb7OskjK6HGG0XF3vllnoyf merchantReferenceCode=HTNsubscription9647 payPalEcGetDetailsReply_paypalBillingAgreementAcceptedStatus=1 payPalEcGetDetailsReply_correlationID=sldkf9325sdfsdlkjgj payPalEcGetDetailsReply_avsCode=3 payPalEcGetDetailsReply_paypalToken=EC-2UN29359TV924162S payPalEcGetDetailsReply_errorCode=93045SLWVO payPalEcGetDetailsReply_addressStatus=Confirmed payPalEcGetDetailsReply_payerID=S6D5ETGSVYX94 payPalEcGetDetailsReply_payerStatus=verified payPalEcGetDetailsReply_payerFirstname=Jane payPalEcGetDetailsReply_payerLastname=Smith payPalEcGetDetailsReply_payerCountry=US payPalEcGetDetailsReply_payer=jsmith@example.com payPalEcGetDetailsReply_shipToName=Jane Smith payPalEcGetDetailsReply_shipToAddress1=1295 Charleston Rd. payPalEcGetDetailsReply_shipToCity=Mountain View payPalEcGetDetailsReply_shipToState=CA payPalEcGetDetailsReply_shipToCountry=US payPalEcGetDetailsReply_shipToZip=94043 |
payPalCreateAgreementService_run=true merchantID=HomeTownNewspaper merchantReferenceCode=HTNsubscription9647 payPalCreateAgreementService_ payPalCreateAgreementService_paypalEcSetRequestToken= payPalCreateAgreementService_paypalToken=EC-2UN29359TV924162S |
decision=ACCEPT reasonCode=100 payPalCreateAgreementReply_reasonCode=100 requestID=29FJBLS93TBQPSLDGK3H requestToken=Bxwje3Ijb7OskjK6HGG0XF3vllnoyf merchantReferenceCode=HTNsubscription9647 payPalCreateAgreementReply_ |
This example shows how to use a reference transaction to authorize and capture a payment by calling these services:
npayPalDoRefTransactionService
npayPalAuthorizationService
npayPalDoCaptureService
payPalDoRefTransactionService_run=true merchantID=HomeTownNewspaper merchantReferenceCode=HTNsubscription9647 purchaseTotals_currency=USD purchaseTotals_grandTotalAmount=4.99 payPalDoRefTransactionService_paypalBillingAgreementId=3ADOib340UWM8923lf20 payPalDoRefTransactionService_paypalPaymentType=instant |
decision=ACCEPT reasonCode=100 requestID=023mbdgil2spfkgjqdbvn requestToken=slbiw9345BJldbodflBNQCPE1409D9k merchantReferenceCode=HTNsubscription9647 payPalDoRefTransactionReply_reasonCode=100 payPalDoRefTransactionReply_correlationID=4lks03uw2lbwxu payPalDoRefTransactionReply_paypalToken=EC-2UN29359TV924162S payPalDoRefTransactionReply_errorCode=93045SLWVO payPalDoRefTransactionReply_amount=4.99 payPalDoRefTransactionReply_currency=USD payPalDoRefTransactionReply_paypalAmount=4.99 payPalDoRefTransactionReply_paypalBillingAgreementId=3ADOib340UWM8923lf20 payPalDoRefTransactionReply_paypalOrderTime=2009-08-15T17:23:09Z payPalDoRefTransactionReply_paypalPaymentStatus=Completed payPalDoRefTransactionReply_paypalPaymentType=instant payPalDoRefTransactionReply_paypalPendingReason=none payPalDoRefTransactionReply_paypalReasonCode=none payPalDoRefTransactionReply_paypalTaxAmount=0.00 payPalDoRefTransactionReply_paypalTransactiontype=express-checkout payPalDoRefTransactionReply_transactionId=htnsubw30bwlbnq2 |
payPalAuthorizationService_run=true payPalAuthorizationService_paypalOrderId=58X525738C493004E merchantID=HomeTownNewspaper merchantReferenceCode=HTNsubscription9647 purchaseTotals_currency=USD purchaseTotals_grandTotalAmount=4.99 payPalAuthorizationService_paypalDoRefTransactionRequestID= payPalAuthorizationService_paypalDoRefTransactionRequestToken= payPalAuthorizationService_paypalCustomerEmail=jsmith@example.com billTo_email=jsmith@example.com |
decision=ACCEPT reasonCode=100 requestID=49gks2og0g12wrg879aergsk requestToken=SLGQ30B235b0XCV0lskb2369awopSgm merchantReferenceCode=HTNsubscription9647 payPalAuthorizationReply_reasonCode=100 payPalAuthorizationReply_correlationID=4lks03uw2lbwxu payPalAuthorizationReply_errorCode=93045SLWVO payPalAuthorizationReply_amount=4.99 payPalAuthorizationReply_currency=USD payPalAuthorizationReply_paypalAmount=4.99 payPalAuthorizationReply_transactionId=3GT12375C398240X |
payPalDoCaptureService_run=true merchantID=HomeTownNewspaper merchantReferenceCode=HTNsubscription9647 purchaseTotals_currency=USD purchaseTotals_grandTotalAmount=4.99 payPalDoCaptureService_completeType=Complete payPalDoCaptureService_paypalAuthorizationRequestID= payPalDoCaptureService_paypalAuthorizationRequestToken= payPalDoCaptureService_paypalAuthorizationId=9XT12375C2469923X |
decision=ACCEPT reasonCode=100 requestID=203948106391278015965 requestToken=FFv9VEdZAOGh084W7RJzIIzHUTUL merchantReferenceCode=HTNsubscription9647 payPalDoCaptureReply_reasonCode=100 payPalDoCaptureReply_paypalPaymentType=instant payPalDoCaptureReply_paypalPaymentGrossAmount=4.99 payPalDoCaptureReply_paypalTaxAmount=0.00 payPalDoCaptureReply_currency=USD payPalDoCaptureReply_paypalFeeAmount=0.36 payPalDoCaptureReply_amount=4.99 payPalDoCaptureReply_paypalTransactiontype=cart payPalDoCaptureReply_transactionId=4M8612956X2810426 payPalDoCaptureReply_parentTransactionId=9XT12375C2469923X payPalDoCaptureReply_authorizationId=0YU23486D3570034Y payPalDoCaptureReply_paypalPaymentStatus=Completed payPalDoCaptureReply_correlationId=r2lvp9325sdfsdlkjgj payPalDoCaptureReply_errorCode=sboe93045 |
This example shows how to cancel a billing agreement by calling the payPalUpdateAgreementService service.
payPalUpdateAgreementService_run=true merchantID=HomeTownNewspaper merchantReferenceCode=HTNsubscription9647 payPalUpdateAgreementService_paypalBillingAgreementID=3ADOib340UWM8923lf20 payPalUpdateAgreementService_paypalBillingAgreementStatus=Canceled |
decision=ACCEPT reasonCode=100 payPalUpdateAgreementReply_reasonCode=100 requestID=LRMB83bzwl39b8qen requestToken=Ydlt020bjUPZ4bwpc6937prh merchantReferenceCode=HTNsubscription9647 payPalUpdateAgreementReply_addressStatus=Confirmed payPalUpdateAgreementReply_payer=jsmith@example.com payPalUpdateAgreementReply_payerBusiness=Home Town Newspaper payPalUpdateAgreementReply_payerCountry=US payPalUpdateAgreementReply_payerFirstname=Jane payPalUpdateAgreementReply_payerLastname=Smith payPalUpdateAgreementReply_payerId=S6D5ETGSVYX94 payPalUpdateAgreementReply_payerStatus=verified payPalUpdateAgreementReply_paypalBillingAgreementCustom= payPalUpdateAgreementReply_paypalBillingAgreementDesc= payPalUpdateAgreementReply_ payPalUpdateAgreementReply_paypalBillingAgreementStatus=Canceled payPalUpdateAgreementReply_correlationId=4lks03uw2lbwxu payPalUpdateAgreementReply_errorCode=93045SLWVO |
|
To enable item-level fields, contact Cybersource Customer Support to have your account configured for this feature. |
payPalEcSetService_run=true merchantID=HomeTownBooks merchantReferenceCode=HTBorder9647 purchaseTotals_currency=USD payPalEcSetService_paypalReturn=http://www.cybersource.com payPalEcSetService_paypalCancelReturn=http://www.cybersource.com/cancel item_0_productCode=books item_0_productName=Merriam-Webster Dictionary item_0_productSKU=23456 item_0_quantity=1 item_0_unitPrice=22.00 item_0_taxAmount=1.10 item_1_productCode=books item_1_productName=Handbook of English Grammar item_1_productSKU=23458 item_1_quantity=1 item_1_unitPrice=24.00 item_1_taxAmount=1.20 item_2_productCode=books item_2_productName=Roget's Thesaurus item_2_productSKU=23450 item_2_quantity=1 item_2_unitPrice=16.00 item_2_taxAmount=0.80 item_3_productCode=coupon item_3_productName=First-Time Buyer Coupon item_3_productSKU=97531 item_3_quantity=1 item_3_unitPrice=5.00 item_4_productCode=shipping_and_handling item_4_unitPrice=7.95 |
decision=ACCEPT reasonCode=100 payPalEcSetReply_reasonCode=100 requestID=KPTRWUMC123893lsng requestToken=Aeuvj6IjRRjVhjIZWEEvhhf8jZL4YX/I20gRk merchantReferenceCode=HTBorder9647 payPalEcSetReply_paypalToken=349GJlk2jk34993 payPalEcSetReply_correlationID=5lks03uw3lawxz payPalEcSetReply_errorCode=911245SVtsO |
payPalEcGetDetailsService_run=true merchantID=HomeTownBooks merchantReferenceCode=HTBorder9647 payPalEcGetDetailsService_payPalEcSetRequestID=KPTRWUMC123893lsng payPalEcGetDetailsService_paypalEcSetRequestToken= payPalEcGetDetailsService_paypalToken=349GJlk2jk34993 |
decision=ACCEPT reasonCode=100 payPalEcGetDetailsReply_reasonCode=100 requestID=RZ34980sctj2 requestToken=Bxwje3Ijb7OskjK6HGG0XF3vllnoyf merchantReferenceCode=HTBorder9647 payPalEcGetDetailsReply_paypalToken=349GJlk2jk34993 payPalEcGetDetailsReply_correlationID=6ksz03np4lbwxy payPalEcGetDetailsReply_errorCode=822236PXnw3 payPalEcGetDetailsReply_avsCode=3 payPalEcGetDetailsReply_addressStatus=Confirmed payPalEcGetDetailsReply_payerID=S6D5ETGSVYX94 payPalEcGetDetailsReply_payerStatus=verified payPalEcGetDetailsReply_payerFirstname=Jane payPalEcGetDetailsReply_payerLastname=Smith payPalEcGetDetailsReply_payerCountry=US payPalEcGetDetailsReply_payer=jsmith@example.com payPalEcGetDetailsReply_shipToName=Jane Smith payPalEcGetDetailsReply_shipToAddress1=1295 Charleston Rd. payPalEcGetDetailsReply_shipToCity=Mountain View payPalEcGetDetailsReply_shipToState=CA payPalEcGetDetailsReply_shipToCountry=US payPalEcGetDetailsReply_shipToZip=94043 payPalEcGetDetailsReply_paypalTaxAmount=3.10 item_0_productCode=default item_0_productName=Merriam-Webster Dictionary item_0_productSKU=23456 item_0_quantity=1 item_0_unitPrice=22.00 item_1_productCode=default item_1_productName=Handbook of English Grammar item_1_productSKU=23458 item_1_quantity=1 item_1_unitPrice=24.00 item_2_productCode=default item_2_productName=Roget's Thesaurus item_2_productSKU=23450 item_2_quantity=1 item_2_unitPrice=16.00 item_3_productCode=coupon item_3_productName=First-Time Buyer Coupon item_3_productSKU=97531 item_3_quantity=1 item_3_unitPrice=5.00 item_4_productCode=shipping_and_handling item_4_unitPrice=7.95 |
merchantID=HomeTownNewspaper merchantReferenceCode=HTNsubscription9647 payPalTransactionSearchService_run=true payPalTransactionSearchService_startDate=2012-09-25T18:47:13Z payPalTransactionSearchService_endDate=2012-09-25T18:49:13Z payPalTransactionSearchService_paypalCustomerEmail=jsmith@example.com payPalTransactionSearchService_transactionID=93N51798SX666845X payPalTransactionSearchService_invoiceNumber=0001529 payPalTransactionSearchService_grandTotalAmount=5.00 payPalTransactionSearchService_currency=USD payPalTransactionSearchService_paymentStatus=Success payPalTransactionSearchService_payerFirstname=Jane payPalTransactionSearchService_payerLastname=Smith |
merchantReferenceCode=HTNsubscription9647 requestID=3485988938400181552773 decision=ACCEPT reasonCode=100 requestToken=AhjrLwSRefOhK9P3yQ0KIJp7HBMVhNPMrTnpa4sA/H2H payPalTransactionSearchReply_reasonCode=100 payPalTransactionSearchReply_transaction_0_transactionTime=2012-09-25T18:48:11Z payPalTransactionSearchReply_transaction_0_transactionTimeZone=GMT payPalTransactionSearchReply_transaction_0_transactionType=Payment payPalTransactionSearchReply_transaction_0_paypalPayerOrPayeeEmail=jsmith@example.com payPalTransactionSearchReply_transaction_0_customerDisplayName=Jane Smith payPalTransactionSearchReply_transaction_0_transactionID=93N51798SX666845X payPalTransactionSearchReply_transaction_0_paypalPaymentStatus=Completed payPalTransactionSearchReply_transaction_0_grandTotalAmount=5.00 payPalTransactionSearchReply_transaction_0_currency=USD payPalTransactionSearchReply_transaction_0_paypalFeeAmount=-0.45 payPalTransactionSearchReply_transaction_0_paypalNetAmount=4.55 payPalTransactionSearchReply_transaction_1_transactionTime=2012-09-25T18:48:05Z payPalTransactionSearchReply_transaction_1_transactionTimeZone=GMT payPalTransactionSearchReply_transaction_1_transactionType=Authorization payPalTransactionSearchReply_transaction_1_paypalPayerOrPayeeEmail=jsmith@example.com payPalTransactionSearchReply_transaction_1_customerDisplayName=Jane Smith payPalTransactionSearchReply_transaction_1_transactionID=8KV00008PR858651B payPalTransactionSearchReply_transaction_1_paypalPaymentStatus=Completed payPalTransactionSearchReply_transaction_1_grandTotalAmount=5.00 payPalTransactionSearchReply_transaction_1_currency=USD payPalTransactionSearchReply_transaction_1_paypalFeeAmount=0.00 payPalTransactionSearchReply_transaction_1_paypalNetAmount=5.00 |